﻿using Ninject.Modules;
using Ninject.Web.Common;
using WCF.NinjectDependencyInjectionDemo.Core;
using WCF.NinjectDependencyInjectionDemo.Repositories;
using WCF.NinjectDependencyInjectionDemo.Services;

namespace WCF.NinjectDependencyInjectionDemo.Config
{
    public class NinjectConfig : NinjectModule
    {
        public override void Load()
        {
            //Core
            Bind<ICache>().To<Cache>().InSingletonScope();

            //Repositories
            Bind<IContactRepository>().To<ContactRepository>().InRequestScope();

            //Services
            Bind<ContactService>().ToSelf();
        }
    }
}